<?php

use Illuminate\Routing\Router;

Admin::registerAuthRoutes();

Route::group([
    'prefix'        => config('admin.route.prefix'),
    'namespace'     => config('admin.route.namespace'),
    'middleware'    => config('admin.route.middleware'),
], function (Router $router) {

    $router->get('/', 'HomeController@index');
    $router->get('test', 'HomeController@test');
    $router->resource('station', 'StationController');
    $router->resource('carbarn', 'CarbarnController');
    $router->resource('user', 'UserController');
    $router->get('user/json/select', 'UserController@selectJson')->name('user.json.select');
    $router->resource('order', 'OrderController');
    $router->resource('saleitem', 'SaleitemController')->except(['delete']);
    $router->resource('organization', 'OrganizationController');
    $router->resource('order-settlement', 'OrderSettlementController');
    $router->resource('order-settlement-divid', 'OrderSettlementDividController');
    $router->resource('card', 'CardController');
    $router->resource('ticket', 'TicketController');
    $router->resource('card-users', 'CardUserController');
    $router->resource('ticket-users', 'TicketUserController');


    $router->get('carbarn/json/top-today', 'CarbarnController@topToday')->name('carbarn.top-today');
    $router->post('carbarn-reset', 'CarbarnController@reset')->name('carbarn.reset');
    $router->get('station/json/top-today', 'StationController@topToday')->name('station.top-today');
    $router->get('order/json/trend-today', 'OrderController@trendToday')->name('order.trend-today');

    $router->post('station/status/toggle', 'StationController@toggleStatus')->name('station.toggle-status');

});

//以下路由不能有验证
Route::group([
    'namespace'     => config('admin.route.namespace'),
], function (Router $router) {
    $router->get('qrc', 'CarbarnController@qrcodeWeixin')->name('carbarn.qrcode.weixin');
    $router->get('qrc-app', 'CarbarnController@qrcodeApp')->name('carbarn.qrcode.app');

});